<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>传递函数</title>
</head>
<body>
<script>
    function toCentigrade(degreesFahrenheit) {
        var degreesCentigrade = 5 / 9 * (degreesFahrenheit - 32);
        document.write(degreesFahrenheit + ' Fahrenheit is ' + degreesCentigrade + ' Celsius.<br/>');
    }

    function toFahrenheit(degreesCentigrade) {
        var degreesFahrenheit = 9 / 5 * degreesCentigrade + 32;
        document.write(degreesCentigrade + ' Celsius is ' + degreesFahrenheit + ' Fahrenheit.<br/>');
    }

    function convert(converter, temperature) {
        converter(temperature);
    }

    convert(toFahrenheit, 23);
    convert(toCentigrade, 75);
</script>
</body>
</html>